//
//  NSObject+Common.m
//  Coding_My
//
//  Created by showXxie on 2017/8/21.
//  Copyright © 2017年 sooxie. All rights reserved.
//
#define kBaseURLStr @"https://coding.net/"

#import "NSObject+Common.h"

@implementation NSObject (Common)

#pragma mark BaseURL
+ (NSString *)baseURLStr{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    return [defaults valueForKey:kBaseURLStr] ?: kBaseURLStr;
}

#pragma mark File M
//获取fileName的完整地址
+ (NSString* )pathInCacheDirectory:(NSString *)fileName
{
    NSArray *cachePaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    NSString *cachePath = [cachePaths objectAtIndex:0];
    return [cachePath stringByAppendingPathComponent:fileName];
}

+ (BOOL)baseURLStrIsProduction{
    return [[self baseURLStr] isEqualToString:kBaseURLStr];
}


@end
